
package com.studiofortress.sf.graphics.display;

/**
 * An event that occurres when the mouse is clicked. It stores
 * Controls.MOUSE_LEFT, Controls.MOUSE_RIGHT or Controls.MOUSE_MIDDLE as the
 * mouse that was pressed.
 *
 * @author Joseph Lenton - JosephLenton@StudioFortress.com
 */
public class ControlClickEvent extends ControlEvent
{
    private final int button;

    /**
     * Creates a new click event for representing the button that was pressed.
     * @param button The mouse button pressed down.
     */
    ControlClickEvent(int button)
    {
        this.button = button;
    }

    /**
     * @return A number held by Controls.MOUSE_LEFT, MOUSE_RIGHT or MOUSE_MIDDLE.
     */
    public int getMouseButton()
    {
        return button;
    }
}
